<!DOCTYPE html>
<html lang="en">
<!--头部信息-->
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" href="../../../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../css/public.css" media="all">

    <script src="../../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>

    <style>
        body {
            background-color: #ffffff;
        }
    </style>

</head>
<!--已删除用户  用户信息-->
<body>
<form id="edit" action="">
    <div class="layui-form layuimini-form">
        <div style="padding-left: 450px">
            <h1>用户信息</h1>
        </div>
        <br>
        <br>
        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="grid-demo grid-demo-bg1">
                        <!--编号-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">编号：</label>
                            <div class="layui-input-block" id="delId" style="width: 80%">
                                <label name="delId" class="layui-form-label-col "></label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="grid-demo">
                        <!--用户ID-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">用户ID：</label>
                            <div class="layui-input-block" id="delDieId" style="width: 80%">
                                <label name="delDieId" class="layui-form-label-col "></label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="grid-demo grid-demo-bg1">
                        <!--姓名-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">用户名：</label>
                            <div class="layui-input-block" id="delName" style="width: 80%">
                                <label name="delName" class="layui-form-label-col "></label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="grid-demo">
                        <!--性别-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">用户性别：</label>
                            <div class="layui-input-block" id="delSex" style="width: 80%">
                                <label name="delSex" class="layui-form-label-col "></label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="grid-demo grid-demo-bg1">
                        <!--死亡寿命-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">死亡寿命：</label>
                            <div class="layui-input-block" id="delAge" style="width: 80%">
                                <label name="delAge" class="layui-form-label-col "></label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="grid-demo">
                        <!--死亡原因-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">死亡原因：</label>
                            <div class="layui-input-block" id="delWhy" style="width: 80%">
                                <label name="delWhy" class="layui-form-label-col"></label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="grid-demo grid-demo-bg1">
                        <!--是否轮回-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">是否轮回：</label>
                            <div class="layui-input-block" id="delReinState" style="width: 80%">
                                <label name="delReinState" class="layui-form-label-col "></label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="grid-demo">
                        <!--死亡时间-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">死亡时间：</label>
                            <div class="layui-input-block" id="delTime" style="width: 80%">
                                <label name="delTime" class="layui-form-label-col "></label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="grid-demo grid-demo-bg1">
                        <!--用户描述-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">用户描述：</label>
                            <div class="layui-input-block" id="delDesc" style="width: 80%">
                                <label name="delDesc" class="layui-form-label-col "></label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="grid-demo">

                    </div>
                </div>
            </div>
        </div>
        <br>
        <br>
        <br>
        <div class="layui-container" style="text-align: center">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="grid-demo grid-demo-bg1">
                        <!--退回死薄-->
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="backBtn">退回死薄</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="grid-demo">
                        <!--永久删除-->
                        <div class="layui-form-item">
                            <div class="layui-input-block" style="float: left">
                                <button class="layui-btn  layui-btn-danger" lay-submit lay-filter="delBtn">永久删除</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>


<script>
    layui.use(['form', 'layer', 'jquery'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;


        /*退回死薄事件*/
        form.on('submit(backBtn)', function (data) {
            layer.confirm("确认退回死薄吗？", {icon: 3}, function (index) {
                var id = $("#delId label").text();
                /*发送修改请求*/
                $.ajax({
                    type: 'POST',
                    dataType: 'text',
                    url: '/backDiebook/' + id,
                    error: function () {
                        layer.alert("系统错误！");
                    },
                    success: function (result) {
                        if (result === 'success') {
                            layer.alert('退回成功！',
                                {
                                    title: '成功',
                                    skin: 'layui-layer-molv',
                                    btn: ['返回'],
                                    anim: 1,
                                    icon: 6,
                                    yes: function () {
                                        parent.layui.table.reload('testId', {
                                            page: {
                                                curr: 1
                                            },
                                        });
                                        layer.close(index);
                                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                                    }
                                });
                        } else {
                            layer.alert('退回失败，请重试？',
                                {
                                    title: '错误',
                                    skin: 'layui-layer-molv',
                                    btn: ['重试', '退出'],
                                    anim: 1,
                                    icon: 5,
                                    yes: function (index) {
                                        layer.close(index);
                                    },
                                    btn2: function () {
                                        layer.close(index);
                                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                                    }
                                });
                        }
                    }
                });
            });
            return false;
        });


        /*永久删除事件*/
        form.on('submit(delBtn)', function (data) {
            var id = $("#delId label").text();
            layer.confirm("确认永久删除该用户吗？", {icon: 3}, function (index) {
                /*发送修改请求*/
                $.ajax({
                    type: 'DELETE',
                    dataType: 'text',
                    url: '/deleteByid/' + id,
                    error: function () {
                        layer.alert("系统错误！");
                    },
                    success: function (result) {
                        if (result === 'success') {
                            layer.alert('删除成功！',
                                {
                                    title: '成功',
                                    skin: 'layui-layer-molv',
                                    btn: ['返回'],
                                    anim: 1,
                                    icon: 6,
                                    yes: function () {
                                        parent.layui.table.reload('testId', {
                                            page: {
                                                curr: 1
                                            },
                                        });
                                        layer.close(index);
                                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                                    }
                                });
                        } else {
                            layer.alert('删除失败，请重试？',
                                {
                                    title: '错误',
                                    skin: 'layui-layer-molv',
                                    btn: ['重试', '退出'],
                                    anim: 1,
                                    icon: 5,
                                    yes: function (index) {
                                        layer.close(index);
                                    },
                                    btn2: function () {
                                        layer.close(index);
                                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                                    }
                                });
                        }
                    }
                });
            });
            return false;
        });
    });
</script>
</body>
</html>